/*
 * Copyright 2010 Yannick Stucki (yannickstucki.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.yannickstucki.android.musicqueue.communication;

import com.yannickstucki.android.musicqueue.data.Song;

/**
 * The interface to control the actual music player.
 * 
 * @author Yannick Stucki (yannickstucki@gmail.com)
 *
 */
public interface IMusicPlayer {
  
  /**
   * Sets the listener which is activated whenever a song has finished playing.
   */
  void setOnSongCompletedListener(OnSongCompletedListener onSongCompletedListener);
  
  /**
   * Plays/resumes the current song.
   */
  void play();
  
  /**
   * Pauses the current song.
   */
  void pause();
  
  /**
   * Sets a song to play.
   */
  void setSong(Song song);
  
  /**
   * Sets a song to play and immediately plays it.
   */
  void setSongAndPlay(Song song);
  
  /**
   * Seeks to a certain time in milliseconds.
   */
  void seekTo(int milliseconds);
  
  /**
   * Returns the current song position in milliseconds.
   */
  int getCurrentPosition();
  
  /**
   * Returns whether the song is playing.
   */
  boolean isPlaying();
  
  /**
   * Destroys the song player to free up resources.
   */
  void destroy();
}
